package com.youthHostel.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.youthHostel.dao.FlatplayDao;
import com.youthHostel.pojo.flatplay;
import com.youthHostel.service.FlatplayService;
@Service
public class FlatplayServiceImpl implements FlatplayService{
	
	@Autowired
	private FlatplayDao flatplayDao;
	
	@Override
	public PageInfo<flatplay> findAll(int index) {
		PageHelper.startPage(index, 3);
		List<flatplay> list = flatplayDao.findAll();
		return new PageInfo<flatplay>(list);
	}

	@Override
	public int deleteByPrimaryKey(Integer id) {
		return flatplayDao.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(flatplay record) {
		return flatplayDao.insert(record);
	}

	@Override
	public flatplay selectByPrimaryKey(Integer id) {
		return flatplayDao.selectByPrimaryKey(id);
	}

	@Override
	public int update(flatplay record) {
		return flatplayDao.updateByPrimaryKey(record);
	}

	@Override
	public List<flatplay> findByName(String name, int index) {
		// TODO Auto-generated method stub
		return flatplayDao.findByName(name);
	}

}
